<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
	<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
	<META HTTP-EQUIV="Expires" CONTENT="0">
    <title>一指赢易购</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <link type="text/css" href="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/css/public.css" rel="stylesheet" />
    <link href="http://localhost:8899/getplan_4TEjId./Public/plugins/css/fonts/iconfont.css" rel="stylesheet" type="text/css" />
	<!--公告开始-->
	 <link href="http://localhost:8899/getplan_4TEjId./Public/plugins/gonggao/style.css" rel="stylesheet" type="text/css" />
	<!--公告结束-->
      <!--新手教程-->
    <link rel="stylesheet" href="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/css/style.css">
    <!--新手教程结束-->
	<script src="http://localhost:8899/getplan_4TEjId./Public/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="http://localhost:8899/getplan_4TEjId./Public/plugins/vue/vue.min.js"></script>
    <script src=http://47.52.224.177:3097/socket.io/socket.io.js"></script>
    <script src="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/js/layer/layer.js"></script>
    <script src="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/js/public.js?v=80"></script>
	<script src="http://localhost:8899/getplan_4TEjId./Public/plugins/gonggao/jquery.cookie.js"></script>
    <link type="text/css" href="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/js/layer/need/layer.css" rel="stylesheet" />
</head>
<body>
<div class="loader">
    <div class="act">
        <div class="spinner">
            <div class="double-bounce1"></div>
            <div class="double-bounce2"></div>
        </div>
    </div>
    <div class="bg"></div>
</div>

<div id="app" app-path="index">
    <pop-buy-component></pop-buy-component>

    <div class="header uk-block uk-block-default">
        <div class="headpor">
            <a href="http://localhost:8899/getplan_4TEjId/user/index">
                <img v-bind:src="avatar" width="63px" />
                <span>个人中心</span>
            </a>
        </div>

        <div class="money">
            <small>余额（元）</small>
            <span>{!user_money.toFixed(2)!}</span>
        </div>

        <div class="right">
            <!--新手教程v-show="pdata[pi].buy_act_time <= 0"-->
           <a   id="client_help" style="font-size: 12px;padding:4px 8px;" class="btn btn-primary small">新手教程</a>
          <!-- 新手教程结束-->
            <!--<a href="http://localhost:8899/getplan_4TEjId/user/couponlist" class="btn btn-primary small" v-if="use_voucher==1">
                <span v-if="couponnumber>0"><img src="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/img/jttsss.png" />&nbsp;&nbsp;{!couponnumber!}张&nbsp;&nbsp;</span>
                <i class="iconfont icon-wodejuanbao"></i>&nbsp;券
            </a>-->
            <a href="http://localhost:8899/getplan_4TEjId/user/withdrawals" class="btn btn-primary small">
                <!--<i class="iconfont icon-icon" style="color:#000000;"></i>&nbsp;-->提&nbsp;现
            </a>
            <a href="http://localhost:8899/getplan_4TEjId/pay/index" class="btn btn-primary small">
                <!--<i class="iconfont icon-chongzhi" style="color:#000000;"></i>&nbsp;-->充&nbsp;值
            </a>

            <div v-if="pdata[pi].buy_act_time > 0" style="border-left:1px solid #dddddd;height:auto;padding:0 5px;margin-left:5px;top: 10px;position:relative;">
                <span style="display:block;color:#000000;font-size:12px;">下单倒计时</span>
                <div style="overflow:hidden;margin-top:10px;">
                    <i class="iconfont icon-shizhong" style="font-size:20px;color:#494949;"></i>
                    <span style="font-size:20px;font-weight:bold;color:#e33134;">{!pdata[pi].buy_act_time | time!}</span>
                </div>
            </div>
        </div>
    </div>

    <div class="menu uk-block  uk-block-default">
        <div class="swiper-wrapper">
        <a class="swiper-slide" v-for="item in pdata" v-bind:class="{'active':select_good==item.game_name}" @click="sel_good($index,item.game_name);">{!item.game_name!}
            <small v-if="type_prices[item.code][1]==2" class="down" style=" display: block;">{!item.bid!} ▼</small>
            <small v-if="type_prices[item.code][1]==1" class="up" style=" display: block;">{!item.bid!} ▲</small>
            <small v-if="type_prices[item.code][1]==0" style="display: block;font-size:12px;color:gray;">[{!item.bid!}]</small>
        </a>
        </div>
    </div>

    <div class="status uk-block  uk-block-default">
        <div class="tab_content" v-for="item in pdata" v-bind:class="{'active':pi==$index}">
            <ul class="attr">
                <li>昨收:{!item.zuoshou!}</li>
                <li>今开:{!item.jingkai!}</li>
                <li>最高:{!item.high!}</li>
                <li>最低:{!item.low!}</li>
            </ul>
        </div>
        <div class="trend_chart">
            <div style="display:none;" class="size_btn" v-if="map_time_name!='M1'">
                <img @click="map_zoom(1)" src="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/img/plus_btn.png" />
                <img @click="map_zoom(-1)" src="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/img/less_btn.png">
            </div>
            <div class="map">
                <div id="container" name="svgh" style="padding: 0px; width: 100%;height: 100%; font-size: 14px;"></div>
                <!--div id="myChart" class="trade-box info-box" style="padding-bottom:0;height:200px"></div-->
            </div>
            <ul class="btns" id="btns" style="padding:0 2px;">
                <li  v-for="item in pdata[pi].data_list"  @click="set_map(item.key, item.value, item.type)" v-bind:class="{'active':map_time_name==item.key}">{!item.name!}</li>
            </ul>
        </div>
    </div>
    <div class="buy_btns">
        <?php if($login_state == 2): ?><a class="btn btn-danger upBtn" @click="buy(1)">订购 ▲</a>
            <a class="btn btn-success downBtn" @click="buy(2)">回购 ▼</a>
            <?php elseif($login_state == 1): ?>
            <a href="http://localhost:8899/getplan_4TEjId/index/bind_mobile_phone" style="float: left;box-sizing: border-box;text-align: center;line-height: 35px;font-size: 16px;width:100%;background-color: #f91800;color: #fff;margin-left:0;" class="btn">点击注册，3秒完成</a>
            <?php else: ?>
            <a href="http://localhost:8899/getplan_4TEjId/index/login" style="float: left;box-sizing: border-box;text-align: center;line-height: 35px;font-size: 16px;width:100%;background-color: #f91800;color: #fff;margin-left:0;" class="btn">马上登录</a><?php endif; ?>
    </div>
    <div class="order_list" v-for="item in pdata" v-bind:class="{'active':pi==$index}" v-if="item.position_order.length > 0">
        <div class="goods_staus deal-bar-item">
            <div class="goods_staus_item">
                <span class="label goods_staus_up" v-if="item.position_order[0].type==1">购</span>
                <span class="label goods_staus_down" v-if="item.position_order[0].type==2">售</span>
                <span class="value">{!item.position_order[0].play_name!}</span>
            </div>
            <div class="goods_staus_item">
                <span class="label">{!item.position_order[0].num!}</span>
                <span class="value">数量</span>
            </div>
            <div class="goods_staus_item">
                <span class="label">{!item.position_order[0].open_price!}</span>
                <span class="value">建仓价</span>
            </div>
            <div class="goods_staus_item">
                <span class="label">{!item.position_order[0].order_contact!}</span>
                <span class="value">止盈止损</span>
            </div>
        </div>
    </div>
</div>
<input id="is_set_password" type="hidden" value="<?php echo ($is_set_password); ?>" />

<!--是否显示新手提示-->
<link type="text/css" href="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/css/index.css?v=80" rel="stylesheet" />
<link href="http://localhost:8899/getplan_4TEjId./Public/plugins/swiper/swiper-3.3.1.min.css" rel="stylesheet" />
<script src="http://localhost:8899/getplan_4TEjId./Public/plugins/swiper/swiper-3.3.1.jquery.min.js"></script>
<script src="http://localhost:8899/getplan_4TEjId./Public/plugins/amcharts/amcharts.js?v=80"></script>
<script src="http://localhost:8899/getplan_4TEjId./Public/plugins/amcharts/serial.js?v=80"></script>
<script src="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/js/initializa.js?v=88"></script>
<script src="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/js/components.js?v=10000"></script>
<script src="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/js/index.js?v=33445566"></script>
<script src="http://localhost:8899/getplan_4TEjId/WebApp/Home/View/Public/baofeng/js/Utils.js?v=999"></script>

<script type="text/javascript">
	/*$(window).load(function () {
		console.log("Load Event");
	}).ready(function () {
		console.log("Ready Event");
	}).bind("pageshow", function () {
		console.log("PageShow Event");
	}).bind("pagehide", function () {
		console.log("PageHide Event");
	});*/

	/*window.addEventListener("popstate", function(e) { 
		alert("我监听到了浏览器的返回按钮事件啦");//根据自己的需求实现自己的功能 
	}, false);
	
	jQuery(document).ready(function($) {

	  if (window.history && window.history.pushState) {

		$(window).on('popstate', function() {
		  var hashLocation = location.hash;
		  var hashSplit = hashLocation.split("#!/");
		  var hashName = hashSplit[1];

		  if (hashName != '') {
			var hash = window.location.hash;
			if (hash == '') {
			  alert('後退按鈕點擊');
			}
		  }
		});

		window.history.pushState('forward', null, './#forward');
	  }

	});*/

    var pageData = <?php echo ($games); ?>;
    var avatar = "<?php echo ($avatar); ?>";
    if(null == avatar || avatar == "") {
        avatar = "http://localhost:8899/getplan_4TEjId/Public/images/null_photo.jpg";
    }
    var balance = <?php echo ($balance); ?>;

    var ROOT = "http://localhost:8899/getplan_4TEjId";

    //获取小数列表
    var decimal_list = {};
    for (var i = 0; i < pageData.length; i++) {
        var data = pageData[i];
        decimal_list[data.code.toString()] = data.decimal_digit.toString();
    }

    var couponnumber = '<?php echo ($couponnumber); ?>'; //券数量
    var use_voucher = '<?php echo ($use_voucher); ?>';
    var exit_time = 3;

    $(function() {
        take_socket();
		
		var login_state = "<?php echo ($login_state); ?>";
        if (login_state != 2) {
            exit();
        }
    });
	
	function exit() {
        var login_state = "<?php echo ($login_state); ?>";
        if (exit_time > 0) {
            exit_time--;
            setTimeout(exit, 1000);
        } else {
            var url = "";
            if (login_state == 0) {
                url = "http://localhost:8899/getplan_4TEjId/index/login";
            } else if (login_state == 1) {
                url = "http://localhost:8899/getplan_4TEjId/index/bind_mobile_phone";
            }
            window.location.href = url;
        }
    }
	
    window.onpageshow = function(event){
		//document.execCommand('Refresh');
        if (event.persisted) {
			//alert("111");
            window.location.reload();
			//window.navigate(location);
        }
    }
	
	$(window).unload(function () { });
</script>

<script type="text/javascript">
    var socket = io.connect('http://47.52.224.177:3097');
    function take_socket() {
        socket.on('connect', function () {
            // socket.emit('user_login', <?php echo (!empty($Think.session.user_id))?session('user_id'):0;?>);
			var user_id = '<?php echo (session('user_id')); ?>';
            if (user_id != null && user_id != "") {
                socket.emit('user_login', user_id);
            }
        });
        socket.on('disconnect', function () {
            // console.log(11111);
            //alert("111");
			// window.location.reload(true);
			// window.navigate(location);
        });
        socket.on('connect_failed', function () {
            // console.log(22222);
            //alert("222");
        });
        socket.on('error', function () {
            // console.log(33333);
            //alert("333");
        });
        socket.on('reconnect_failed', function () {
            // console.log(44444);
            //alert("444");
        });

        socket.on('open_order', function (data){
			console.log(data);
            if ($("div[app-path='index']")) {
                vue.open_lottery(data);
            }
        });

        socket.on('new_second', function (v) {
            if ($("div[app-path='index']")) {
                // console.log("有新数据来了");
                for (var i=0; i<v.list.length; i++) {
                    v.list[i].time = v.time;
                }
                vue.new_update_price(v.list);
            }
        });

        socket.on('second', function (v) {
            // console.log("有新数据来了");
            // console.log(v);
            if ($("div[app-path='index']")) {
                vue.update_price(v);
                // close_loadpage();
            }
        });
    }
</script>
<!--新手教程开始-->
<div class="guide_box" id="guide_box">
    <div data-step="1">
        <div class="girl">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/girl1.png">
            <p>挑选喜欢的产品,</p>
            <p>跟我一起</p>
            <p>来赚取您的第一桶金吧~</p>
        </div>
        <div class="sign3"><img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/jiantou.png"></div>
        <div class="prompt">
            <p><b>1</b><span>选择产品类型</span></p>
            <div>
                <a class=" next">下一步</a>
            </div>
        </div>
        <div class="bg1"></div>
        <div class="bg2"></div>
        <div class="cover"></div>
    </div>
    <div data-step="2">
        <div class="girl">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/girl2.png">
        </div>
        <div class="sign3"><img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/jiantou.png"></div>
        <div class="prompt">
            <p><b>2</b><span>判断走势，选择订购或回购。</span></p>
            <div>
                <a class=" prev">上一步</a>
                <a class=" next">下一步</a>
            </div>
        </div>
        <div class="bg1"></div>
        <div class="bg2"></div>
        <div class="cover"></div>
    </div>
    <div data-step="3">
        <div class="girl">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/tk1.png">
        </div>
        <div class="sign3"><img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/jiantou.png"></div>
        <div class="prompt">
            <p style="text-align: left;width:308px;margin: 0 auto;">
                <b>3</b>
                <span>选择合约交易额、止损/止盈</span>
                <br>
                <b style="color:transparent;">3</b>
                <span>数量并确定下单。</span>
            </p>
            <div>
                <a class=" prev">上一步</a>
                <a class=" next">下一步</a>
            </div>
        </div>
        <div class="bg1"></div>
        <div class="bg2"></div>
        <div class="cover"></div>
    </div>
    <div data-step="4">
        <div class="girl">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/tk5.png">
        </div>
        <div class="sign3"><img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/jiantou.png"></div>
        <div class="prompt">
            <p><b>4</b><span>首次下单需要设置交易密码。</span></p>
            <div>
                <a class=" prev">上一步</a>
                <a class=" next">下一步</a>
            </div>
        </div>
        <div class="bg1"></div>
        <div class="bg2"></div>
        <div class="cover"></div>
    </div>
    <div data-step="5">
        <div class="girl">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/girl3.png">
        </div>
        <div class="sign3"><img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/jiantou.png"></div>
        <div class="prompt">
            <p style="text-align: left;width: 142px;margin: 0 auto;">
                <b>5</b>
                <span>下单成功</span>
                <br>
                <b style="color:transparent;">5</b>
                <span>请静待结果。</span>
            </p>
            <div>
                <a class=" prev">上一步</a>
                <a class=" next">下一步</a>
            </div>
        </div>
        <div class="jiancang">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/tk2.png">
        </div>
        <div class="bg1"></div>
        <div class="bg2"></div>
        <div class="cover"></div>
    </div>
    <div data-step="6">
        <div class="girl">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/tk3.png">
        </div>
        <div class="sign3"><img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/jiantou.png"></div>
        <div class="sign2"><img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/jiantou.png"></div>
        <div class="prompt">
            <p style="text-align: left;width:295px;margin: 0 auto;">
                <b>6</b>
                <span>可以在“我的交易轨迹”查看</span>
                <br>
                <b style="color:transparent;">6</b>
                <span>交易详情。</span>
            </p>
            <div>
                <a class=" prev">上一步</a>
                <a class=" next">下一步</a>
            </div>
        </div>
        <div class="jiancang">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/tk4.png">
        </div>
        <div class="click_guiji">
            <span>点击“我的交易轨迹”</span>
        </div>
        <div class="click_me">
            <span>点击“我”</span>
        </div>
        <div class="me_img">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/me.png">
        </div>
        <div class="bg1"></div>
        <div class="bg2"></div>
        <div class="cover"></div>
    </div>
    <div data-step="7">
        <div class="girl">
            <img src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/img/end.png">
            <p style="margin-top：20px;text-align: center;font-size: 16px;">马上开始您的交易吧！</p>
            <p style="text-align: center;font-size: 16px;">如还有其他问题，请联系客服</p>
        </div>
        <div class="confirm">
            <button>确定</button>
        </div>
        <div class="bg1"></div>
        <div class="bg2"></div>
        <div class="cover"></div>
    </div>
</div>
<script src="http://localhost:8899/getplan_4TEjId./Public/plugins/jiaocheng/js/main.js"></script>
<!--新手教程结束-->



<div class="nav">
    <nav>
        <a href="http://localhost:8899/getplan_4TEjId/shopping/index"><i class="iconfont icon-shangcheng"></i><br>商城</a>
        <a href="http://localhost:8899/getplan_4TEjId/shopping/extract"><i class="iconfont icon-lipin"></i><br>提货劵</a>
        <a href="http://localhost:8899/getplan_4TEjId/index" class="red"><i class="iconfont icon-jiaoyi"></i><br>交易</a>
        <a href="http://localhost:8899/getplan_4TEjId/user/index"><i class="iconfont icon-my"></i><br>我&nbsp;</a>
    </nav>
</div>
<!--公告开始-->
<div id="alert_notice">
    <div id="notice">
        <h3 class="title"></h3>
        <p class="respect"></p>
        <p class="content"></p>
        <p class="author"></p>
        <p class=" notice_time"></p>
        <button class="know">我已知晓</button>
    </div>
</div>
<script src="http://localhost:8899/getplan_4TEjId./Public/plugins/gonggao/gonggao.js"></script>
<!--公告结束-->


</body>

</html>